package com.whiteape.book.ui.adapter;

import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatCheckedTextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.whiteape.book.R;
import com.whiteape.book.model.dto.ReplaceRuleBean;

import java.util.List;

public class ReplaceRuleAdapter extends BaseQuickAdapter<ReplaceRuleBean, BaseViewHolder> {


    public ReplaceRuleAdapter(int layoutResId, @Nullable List<ReplaceRuleBean> data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, ReplaceRuleBean item) {

        helper.addOnClickListener(R.id.iv_edit);
        helper.addOnClickListener(R.id.iv_del);
        helper.addOnClickListener(R.id.tv_replace_rule);
        helper.setText(R.id.tv_replace_rule, item.getReplaceSummary());
        ((AppCompatCheckedTextView)helper.getView(R.id.tv_replace_rule)).setChecked(item.getEnable());


    }

}
